<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreatePaymentRecord extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('payment_record', function (Blueprint $table) {
            $table->increments('id')->comment('自增ID');
            $table->string('payment_id',45)->comment('订单号')->unique();
            $table->string('transaction_id',45)->comment('微信订单号');
            $table->decimal('total', 10, 2)->comment('金额');
            $table->integer('item_id')->comment('项目id');
            $table->tinyInteger('item_type')->comment('项目类型');
            $table->integer('user_id')->comment('支付人');
            $table->integer('trader_id')->comment('机构id');
            $table->tinyInteger('status')->comment('状态');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('payment_record', function (Blueprint $table) {
            //
        });
    }
}
